[Top] [Prev] [Next] [Bottom] [Contents]

SaCopyLocalBuffer

Copies a string into the local ring buffer, to be used with SaGet Functions.

Synopsis

#include "SaPopCalls.h"
char *SaCopyLocalBuffer(char *str);

Arguments

str
Pointer to a string or NULL.

Return Values

Returns a pointer to an exact duplicate of the str argument. The returned value should not be free'd.

Description

SaCopyLocalBuffer returns a duplicate of the string passed to it in the str argument.

SaCopyLocalBuffer adds a copy of the str buffer to the local ring buffer that is managed in SaPopCalls.c and returns a pointer to the copy in the ring buffer.

The ring buffer is a list of up to 10 strings. When an eleventh item is added to it, the first item is removed and free'd and the eleventh item is appended to the end of the ring buffer. This assures that functions using the ring buffer can be called nine times before buffers are free'd and therefore become invalid.

This is used primarily with Widget HTML Form Element Extraction functions that are embedded in other functions which require character pointers. This eliminates the need to free a returned string since it will be free'd automatically once the 11th string is added.

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.